1. Module (chicken platform)
    1. Build information
      1. build-platform
      2. chicken-version
      3. include-path
      4. repository-path
      5. installation-repository
    2. system-config-directory
    3. system-cache-directory
    4. Machine information
      1. machine-byte-order
      2. machine-type
    5. Software information
      1. software-type
      2. software-version
    6. Feature identifiers
      1. features
      2. feature?
      3. register-feature!
      4. unregister-feature!
    7. Returning to the host program
    8. return-to-host

Module (chicken platform)

This module provides procedures for obtaining information about the platform on which the program is currently running.

Build information

These procedures return information about options that can be specified at build time.

build-platform

[procedure] (build-platform)

Returns a symbol specifying the toolset which has been used for building the executing system, which is one of the following:

cygwin
mingw32
gnu
intel
clang
sun
unknown

chicken-version

[procedure] (chicken-version [FULL])

Returns a string containing the version number of the CHICKEN runtime system. If the optional argument FULL is given and true, then a full version string is returned.

include-path

[procedure] (include-path)

Returns a list of strings representing directory names where included files are located, which defaults to the value of the environment variable CHICKEN_INCLUDE_PATH, split on : (or ; on Windows). If the variable is not set, the list is initialized to contain the installation directory (usually /usr/local/share/chicken on UNIX-like systems).

repository-path

[parameter] repository-path

Contains a list of strings naming the paths to the extension repository, which defaults to the value of the environment variable CHICKEN_REPOSITORY_PATH, split on : (or ; on Windows). If the environment variable is not set, it will be a list containing the default library path (usually /usr/local/lib/chicken on UNIX systems).

installation-repository

[parameter] installation-repository

Contains the name of the directory where extensions are installed (as opposed to the possible locations where they can be loaded or linked at runtime.)

system-config-directory

[procedure] (system-config-directory)

Returns the location of the directory for configuration files. This obeys the XDG specification, so when the XDG_CONFIG_HOME environment variable is set, its value is used. When it's not set, it will default to $HOME/.config on UNIX and $APPDATA on Windows.

system-cache-directory

[procedure] (system-cache-directory)

Returns the location of the directory for caches. This obeys the XDG specification, so when the XDG_CACHE_HOME environment variable is set, its value is used. When it's not set, it will default to $HOME/.cache on UNIX and $LOCALAPPDATA or $APPDATA on Windows.

Machine information

These procedures return information about the type of CPU/architecture the program is running on.

machine-byte-order

[procedure] (machine-byte-order)

Returns the symbol little-endian or big-endian, depending on the machine's byte-order.

machine-type

[procedure] (machine-type)

Returns a symbol specifying the processor on which this process is currently running, which is one of the following:

arm
alpha
mips
hppa
ultrasparc
sparc
ppc
ppc64
ia64
x86
x86-64
unknown

Software information

These procedures return information about the type of operating system the program is running on.

software-type

[procedure] (software-type)

Returns a symbol specifying the operating system on which this process is currently running, which is one of the following:

android
windows
unix
ecos
unknown

software-version

[procedure] (software-version)

Returns a symbol specifying the operating system version on which this process is currently running, which is one of the following:

linux
freebsd
netbsd
openbsd
macosx
hpux
dragonfly
haiku
solaris
sunos
aix
hurd
unknown

Feature identifiers

CHICKEN maintains a global list of features naming functionality available in the current system. Additionally the cond-expand form accesses this feature list to infer what features are provided. Predefined features are chicken, and the SRFIs (Scheme Request For Implementation) provided by the base system: srfi-23, srfi-30, srfi-39. If the eval unit is used (the default), the features srfi-0, srfi-2, srfi-6, srfi-8, srfi-9 and srfi-10 are defined. When compiling code (during compile-time) the feature compiling is registered. When evaluating code in the interpreter (csi), the feature csi is registered.

features

[procedure] (features)

Returns a list of all registered features that will be accepted as valid feature-identifiers by cond-expand.

feature?

[procedure] (feature? ID ...)

Returns #t if all features with the given feature-identifiers ID ... are registered.

register-feature!

[procedure] (register-feature! FEATURE ...)

Register one or more features that will be accepted as valid feature-identifiers by cond-expand. FEATURE ... may be a keyword, string or symbol.

unregister-feature!

[procedure] (unregister-feature! FEATURE ...)

Unregisters the specified feature-identifiers. FEATURE ... may be a keyword, string or symbol.

Returning to the host program

return-to-host

[procedure] (return-to-host)

Exits the Scheme code and returns to the invoking context that called CHICKEN_run or CHICKEN_continue.

After return-to-host has been executed and once CHICKEN_run returns, you can invoke callbacks which have been defined with define-external.


Previous: Module (chicken pathname)

Next: Module (chicken plist)